#!/bin/bash
# run
KMOD=3_kprobe
USE_VI=0

[ ${USE_VI} -eq 1 ] && {
  sudo dmesg -C && make && sudo ./test.sh ${USE_VI} && sleep .1
  vi /0setup*
  sudo rmmod ${KMOD} 2>/dev/null && sudo dmesg
} || {
  echo "sudo dmesg -C && make && sudo ./test.sh ${USE_VI} && sleep 5 && sudo rmmod ${KMOD} 2>/dev/null && sudo dmesg"
  sudo dmesg -C && make && sudo ./test.sh ${USE_VI}
  ls -l >/dev/null; sleep 5
  sudo rmmod ${KMOD} 2>/dev/null
  sudo dmesg
}
